package com.action.boot.mongo.mongo_template.util;

import com.mongodb.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;

/**
 * Created by Wuxiang on 2017/10/24.
 */
public class MongoUtil {
    public static MongoCollection<Document> getCollection() {
        MongoClient mongoClient = new MongoClient("127.0.0.1", 27017);
        MongoDatabase database = mongoClient.getDatabase("newdb");
        MongoCollection<Document> collection = database.getCollection("order");
        return collection;
    }
}
